package com.dm.userservice;

import com.dm.userservice.impl.UserFeignClientFallback;
import com.springcloud.demo.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "dm-user-provider",fallback = UserFeignClientFallback.class)
public interface UserFeignClient {

    @GetMapping(value = "/login")
    public String login();

    @PostMapping(value = "/login1")
    public boolean login1(@RequestParam("name") String name, @RequestParam("pwd") String pwd);
    @PostMapping(value = "/login2")
    public boolean login2(@RequestBody User user);

    @PostMapping(value = "/login3")
    public String login3(@RequestParam("count") Integer count);

}
